//
//  LSNetWorkTool.m
//  yiYuanDuoBao
//
//  Created by 罗李苏 on 16/11/25.
//  Copyright © 2016年 罗李苏. All rights reserved.
//

#import "LSNetWorkTool.h"

@implementation LSNetWorkTool
+(instancetype)sharedNetWorkTool{

    static LSNetWorkTool *tool;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        tool = [[LSNetWorkTool alloc] init];
    });
    return tool;
}

-(AFHTTPSessionManager *)manager{

    if (!_manager) {
        _manager = [AFHTTPSessionManager manager];
        _manager.requestSerializer = [AFJSONRequestSerializer serializer];
        _manager.responseSerializer = [AFJSONResponseSerializer serializer];
        NSSet *set = [NSSet setWithObjects:@"text/plain",@"text/html",nil];
        _manager.responseSerializer.acceptableContentTypes = [_manager.responseSerializer.acceptableContentTypes setByAddingObjectsFromSet:set];
    }
    return _manager;
}
@end
